package com.joekai.view_demo;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ListView;

import androidx.appcompat.app.AppCompatActivity;

import com.joekai.view_demo.QQ_step.QQStepActivity;
import com.joekai.view_demo.dot_loading.DotLoadingActivity;
import com.joekai.view_demo.foldList.FoldListActivity;
import com.joekai.view_demo.gather_loading.GatherLoadingActivity;
import com.joekai.view_demo.heart_like.HeartLikeActivity;
import com.joekai.view_demo.kugou_guide_page.GuidePageActivity;
import com.joekai.view_demo.kugou_sideslip.SideslipActivity;
import com.joekai.view_demo.letter_index.LetterIndexListActivity;
import com.joekai.view_demo.main.MainAdapter;
import com.joekai.view_demo.main.MainItem;
import com.joekai.view_demo.message_drag.MessageDragActivity;
import com.joekai.view_demo.multi_menu.MultiMenuActivity;
import com.joekai.view_demo.red_package.RedPackageActivity;
import com.joekai.view_demo.shape_loading.ShapeLoadingActivity;
import com.joekai.view_demo.text_change_color.TextChangeColorActivity;
import com.joekai.view_demo.zdy_progress_bar.ZdyProgressBarActivity;
import com.joekai.view_demo.zdy_text.TextActivity;

import java.util.ArrayList;
import java.util.List;


public class MainActivity extends AppCompatActivity {
    ListView lvMain;
    List<MainItem> list = new ArrayList<>();

    private void addList() {
        list.add(new MainItem("自定义TextView", TextActivity.class));
        list.add(new MainItem("仿QQ运动步数", QQStepActivity.class));
        list.add(new MainItem("切换ViewPage改变Title颜色", TextChangeColorActivity.class));
        list.add(new MainItem("自定义进度条", ZdyProgressBarActivity.class));
        list.add(new MainItem("图形切换加载框", ShapeLoadingActivity.class));
        list.add(new MainItem("字母索引列表", LetterIndexListActivity.class));
        list.add(new MainItem("仿酷狗首页侧滑", SideslipActivity.class));
        list.add(new MainItem("汽车之家折叠列表", FoldListActivity.class));
        list.add(new MainItem("多菜单内容筛选", MultiMenuActivity.class));
        list.add(new MainItem("圆点切换加载框", DotLoadingActivity.class));
        list.add(new MainItem("消息拖拽", MessageDragActivity.class));
        list.add(new MainItem("心形点赞", HeartLikeActivity.class));
        list.add(new MainItem("酷狗视差引导页", GuidePageActivity.class));
        list.add(new MainItem("聚合加载框效果", GatherLoadingActivity.class));
        list.add(new MainItem("红包效果", RedPackageActivity.class));


    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        addList();
        lvMain = findViewById(R.id.lv_main);
        MainAdapter adapter = new MainAdapter(MainActivity.this, R.layout.adapter_main_item, list);
        lvMain.setAdapter(adapter);
        lvMain.setOnItemClickListener((adapterView, view, i, l) ->
                startActivity(new Intent(MainActivity.this, list.get(i).value)));
    }
}